Skip to content

Keep safe haven cash for unbuyable small accounts - #110

Merged
Pigbibi merged 1 commit into
mainfrom
fix-small-account-safe-haven-cash
May 27, 2026
Merged

Keep safe haven cash for unbuyable small accounts#110
Pigbibi merged 1 commit into
mainfrom
fix-small-account-safe-haven-cash

Conversation

@Pigbibi

@Pigbibi Pigbibi commented May 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • zero the safe-haven target when whole-share projection removes the only non-safe-haven target
  • expose the safe-haven cash substitution in the execution summary
  • update pinned QuantPlatformKit and UsEquityStrategies versions for delayed IBKR quote snapshots and smart DCA localization
  • add an IBKR execution test for the 15% SOXX / 85% BOXX small-account case

Verification

  • python -m py_compile application/execution_service.py tests/test_execution_service.py
  • Not run locally: python -m pytest tests/test_execution_service.py -k 'projects_unbuyable_weight_target_to_zero or keeps_safe_haven_cash_when_only_risk_target_is_unbuyable' (local Python environment is missing pandas)

@Pigbibi
Pigbibi force-pushed the fix-small-account-safe-haven-cash branch from cf81991 to b27b2a4 Compare May 27, 2026 03:17

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cf81991371

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +754 to +755
target_mv[normalized_symbol] = 0.0
target_weights[normalized_symbol] = 0.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Recompute realized safe-haven weight after cash substitution

When a small account's only positive risk target is projected to cash, this branch zeroes the safe-haven target but leaves execution_summary["realized_safe_haven_weight"] at the value computed earlier from the pre-substitution weights. In the new SOXX/BOXX scenario this means reconciliation/reporting can show an 85% realized safe-haven weight while target_vs_current and order generation treat BOXX as 0%, so the summary is internally inconsistent; update the realized safe-haven weight after this substitution.

Useful? React with 👍 / 👎.

@Pigbibi
Pigbibi force-pushed the fix-small-account-safe-haven-cash branch from b27b2a4 to 78ab532 Compare May 27, 2026 03:22
@Pigbibi
Pigbibi force-pushed the fix-small-account-safe-haven-cash branch from 78ab532 to 935704e Compare May 27, 2026 03:30
@Pigbibi
Pigbibi merged commit 9135829 into main May 27, 2026
1 check passed
@Pigbibi
Pigbibi deleted the fix-small-account-safe-haven-cash branch May 27, 2026 03:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant